// pages/assistant/index.js
const {
  post
} = getApp();
Page({
  // 数据
  data: {
    data: {
      total_amount: 0,
      pending_amount: 0,
      remain_amount: 0
    }
  },
  // 初始加载完成
  onLoad: function () {
    post("/assistant/main").then(res => {
      if (res.result == 1) {
        this.setData({
          data: res.data
        })
      };
    })
  },
  // 页面跳转
  goToPage:function(e) {
    wx.navigateTo({
      url: e.currentTarget.dataset.url,
    })
  },
  onShow: function () {
    // 控制分享按钮
    wx.showShareMenu({
      withShareTicket: true,
      menus: ['shareAppMessage', 'shareTimeline'],
      success(res) {
        console.log('showShareMenu', res);
      }
    });
  }
})